<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%adminers}}".
 *
 * @property int $id
 * @property string $password
 * @property string $pwd_back
 * @property int $status 状态200正常99禁用
 * @property int $created_at
 * @property int $updated_at
 * @property string $auth_key session认证秘钥
 * @property string $mobile
 * @property string $account_name 账户名
 * @property int $is_super 1是2否超管
 * @property string $token
 * @property string $key
 */
class Adminers extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%adminers}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['password', 'pwd_back', 'status', 'created_at', 'updated_at', 'auth_key', 'mobile', 'account_name', 'is_super', 'token', 'key'], 'trim'],
            [['password', 'pwd_back', 'created_at', 'updated_at', 'auth_key', 'mobile', 'account_name', 'token', 'key'], 'required'],
            [['password', 'pwd_back'], 'string'],
            [['status', 'created_at', 'updated_at', 'is_super'], 'integer'],
            [['auth_key', 'token', 'key'], 'string', 'max' => 32],
            [['mobile'], 'string', 'max' => 11],
            [['account_name'], 'string', 'max' => 180],
            [['status'], 'default', 'value' => 200],
            [['is_super'], 'default', 'value' => 2],
            [['mobile'], 'unique'],
            [['token'], 'unique'],
            [['account_name'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'password' => Yii::t('app', 'Password'),
            'pwd_back' => Yii::t('app', 'Pwd Back'),
            'status' => Yii::t('app', '状态200正常99禁用'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'auth_key' => Yii::t('app', 'session认证秘钥'),
            'mobile' => Yii::t('app', 'Mobile'),
            'account_name' => Yii::t('app', '账户名'),
            'is_super' => Yii::t('app', '1是2否超管'),
            'token' => Yii::t('app', 'Token'),
            'key' => Yii::t('app', 'Key'),
        ];
    }
}
